package com.simple.proxy.dynamic.cglib;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class CglibProxy implements MethodInterceptor {
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("========Cglib动态代理开始=======");
        Object result = methodProxy.invokeSuper(o, objects);
        System.out.println("========Cglib动态代理结束=======");

        return result;
    }
}
